﻿@page "/tables/cell"
@inject IStringLocalizer<TablesCell> CellLocalizer

<h3>@CellLocalizer["Title"]</h3>

<h4>@CellLocalizer["H4"]</h4>

<DemoBlock Title="@CellLocalizer["MergeCellTitle"]" Introduction="@CellLocalizer["MergeCellIntro"]" Name="MergeCell">
    <p>@((MarkupString)CellLocalizer["MergeCellP"].Value)</p>
    <Pre>.cell-demo {
    background-color: #ddd;
}</Pre>
    <Table TItem="Foo" Items="@Items.Take(3)">
        <TableColumns>
            <TableColumn @bind-Field="@context.DateTime" Width="140" />
            <TableColumn @bind-Field="@context.Name" OnCellRender="@OnCellRenderHandler" />
            <TableColumn @bind-Field="@context.Address" />
        </TableColumns>
    </Table>
</DemoBlock>

<DemoBlock Title="@CellLocalizer["OnDoubleClickCellTitle"]" Introduction="@CellLocalizer["OnDoubleClickCellIntro"]" Name="OnDoubleClickCell">
    <Tips>
        <p>@((MarkupString)CellLocalizer["OnDoubleClickCellP"].Value)</p>
    </Tips>
    <Table TItem="Foo" Items="@Items.Take(3)" IsBordered="true" OnDoubleClickCellCallback="@OnDoubleClickCellCallback">
        <TableColumns>
            <TableColumn @bind-Field="@context.DateTime" Width="180" />
            <TableColumn @bind-Field="@context.Name" />
            <TableColumn @bind-Field="@context.Address" />
            <TableColumn @bind-Field="@context.Complete" />
        </TableColumns>
    </Table>
</DemoBlock>

<AttributeTable Items="GetAttributes()" Title="TableCellArgs"></AttributeTable>
